home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9559 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: news.pi.net!news
  2. From: cat.tech@pi.net (Remy Cool)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Problem: ERROR: Cannot convert 'const void * ' to ' const HBITMAP_* '
  5. Date: Sat, 02 Mar 1996 18:27:19 GMT
  6. Organization: Cool Applied Technology
  7. Message-ID: <4ha40t$rbc@neptunus.pi.net>
  8. References: <4h9a8h$89i@neptunus.pi.net>
  9. Reply-To: cool@pi.net
  10. NNTP-Posting-Host: hen26.pi.net
  11. X-Newsreader: Forte Free Agent 1.0.82
  12.  
  13. Found the sollution.....
  14.  
  15. This is the CODE...
  16.  
  17. HDC hdc, hdcMemory;
  18. HBITMAP hbmpMyBitmap, hbmpOld;
  19. BITMAP bm;
  20.  
  21. hbmpMyBitmap = LoadBitmap(GetApplication()->hInstance, "MyBMP");
  22. GetObject(hbmpMyBitmap, sizeof(BITMAP), &bm);
  23.  
  24. hdc = GetDC(HWindow);
  25. hdcMemory = CreateCompatibleDC(hdc);
  26. hbmpOld =(HBITMAP)SelectObject(hdcMemory, hbmpMyBitmap);    /* LINE 10 */
  27.  
  28. BitBlt(hdc, 100, 100, bm.bmWidth, bm.bmHeight, hdcMemory, 0, 0, SRCCOPY);
  29. SelectObject(hdcMemory, hbmpOld);
  30.  
  31. DeleteDC(hdcMemory);
  32. ReleaseDC(HWindow, hdc);
  33. DeleteObject(hbmpMyBitmap);
  34.  
  35. **** Changes to the original code:
  36.  
  37. Place (HBITMAP) before the SelectObject(.......)   /* LINE 10 */
  38. Remove (all)  #define MyBMP  1000 (from the .rc file)
  39.  
  40. Then it works fine ......
  41.  
  42. Regards,
  43.  
  44. Remy  
  45.  
  46.